<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=iso-8859-1" http-equiv="content-type">
  <title>Map2PDF</title>
  <link href="jsdoc.css" type="text/css" rel="stylesheet">
</head>
<body>
<table width="100%">
<tr valign="top">
<td align="right">
<font size="-2">
<a href="#desc">Description</a>
| <a href="#params">Parameters</a>
| <a href="#examples">Examples</a>
| <a href="#response">Response</a>
</font>
</td>
</tr>
</table>

<div id="pageBanner">
<i>Map2PDF</i>
</div>

<div id="nstext">
  
<a name="desc"/>
<h4 class="dtH4">Description</h4>
</a>

<p>
  The Map2PDF service is used for generating printable PDF webmaps, that are authored using the ArcGIS JavaScript API <br/>
</p>

<p>You can provide arguments to the Map2PDF service as query parameters defined in the parameters table
below.</p>

<a name="params">
<h4 class="dtH4">Parameters</h4>
</a>

  <table class="detailTABLE" cellspacing="0">
  <tbody>
    <tr>
      <th class="detailTABLE">Parameter</th>
      <th class="detailTABLE">Details</th>
    </tr>
    <tr>
      <td class="detailTABLE" valign="top">f</td>
      <td class="detailTABLE" valign="top"><span style="font-style: italic;">Description</span>: The response format.
        The default response format is pdf.<br>
        <br>
        <span style="font-style: italic;">Values</span>: pdf | json | image</td>
    </tr>
    
     <tr>
      <td class="detailTABLE" valign="top">layers</td>
      <td class="detailTABLE" valign="top">
        <span style="font-style: italic;">Description</span>: These represent the Tiled and Dynamic map service layers hosted by the MapControl. It is autogenerated by the
     <code>PrintMap</code> control. For more information on how you can use the <code>PrintMap control</code> see <a href="PrintMap.js">PrintMap.js</a>. <br/><br/>
     The tiled layers are mosaiced on the server side, and the result of the mosaic operation is used in an alpha composite overlay with the images exported by the dynamic
     map service urls and <code>features</code>.  
        <br><br/>
        <span style="font-style: italic;">Examples</span>: <br>
        <br>
        
        <h4>JSON Structures:</h4>

        <div class="detailSample">
        <pre>
{
 "tileLayers":[
   {"tiles":[
      {"url":"http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer/tile/2/0/1","row":0,"col":1},
    {"url":"http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer/tile/2/1/1","row":1,"col":1},
    {"url":"http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer/tile/2/0/2","row":0,"col":2},
    {"url":"http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer/tile/2/1/2","row":1,"col":2},
    {"url":"http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer/tile/2/0/3","row":0,"col":3},
    {"url":"http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer/tile/2/1/3","row":1,"col":3}
  ],
  "transparency":1,
  "clipOptions":{"offsetX":68,"offsetY":395,"width":640,"height":480}
    }
  ],
  "dynamicLayers":[
    {"url":"http://sampleserver1..../export?bbox=-128.97,13.05,-72.72,55.2349&size=640,480&transparent=true&format=png8&f=image",
     "width":640,"height":480,
     "transparency":0.5
    }
  ]
}
        </pre>
        </div>
      </td>
    </tr>
  
     <tr>
      <td class="detailTABLE" valign="top">features</td>
      <td class="detailTABLE" valign="top">
        This represents the features that are currently being displayed on the esri.Map control (in the current extent). Only simple features are supported. Polygons with 
    single rings are supported. The json is the same as that of ESRI Geometry objects with a few additional properties as shown in the <i>example.</i>
    <br/><br/>
    The <code>color</code> attribute represents the fill color of the polygon that is to be used on the server side when rendering this <code>feature</code> as a bit map. 
    The <code>transparency</code> attribute represents the transparency of the generated bitmap, when being overlaid with the mosaiced tiles and the images generated
    by the dynamic map service urls. The <code>width</code> and the <code>height</code> attributes control the width and height of the bitmap generated on the server before the overlay process.
    
    
    These features need to be in the screen coordinate system.
    <br />
        <br>
        <span style="font-style: italic;">Examples</span>: <br>
        <br>
        
        <h4>JSON Structures:</h4>

        <div class="detailSample">

        <pre>
[{
"geometries" : [
 {
  "geometryType" : "esriGeometryPolygon",
  "rings" : [ 
  [ [50,200], [100,100], [150,200], [100,300] ]
 ]     
}
],
"colors" : [
  {"r":127, "g":127, "b":127}
],
"transparency": 0.5,
"width" : 640,
"height" : 480
}]   
        </pre>
        </div>
    </td>
    </tr>
    <tr>
      <td class="detailTABLE" valign="top">pageTitle</td>
      <td class="detailTABLE" valign="top">
      <span style="font-style: italic;">Description</span>: A string that represents the title that needs to be a part of the generated PDF. <br/>
    E.g. <code>pageTitle = "Testing Map2PDF"</code>
     </td>
    </tr>
    <tr>
        <td class="detailTABLE" valign="top">callback</td>
        <td class="detailTABLE" valign="top">
            <span style="font-style: italic;">Description : </span> A callback parameter for a JSONP call. <br/>
        </td>
    </tr>
    <tr>
        <td class="detailTABLE" valign="top">report</td>
        <td class="detailTABLE" valign="top">
            <span style="font-style: italic;">Description : </span> An optional parameter that specifies the name of the report to use.  If not specified the default report generator will be used. <br/>
        </td>
    </tr>
    <tr>
        <td class="detailTABLE" valign="top">reportParams</td>
        <td class="detailTABLE" valign="top">
            <span style="font-style: italic;">Description : </span> An optional parameter that specifies parameters  and values that will be passed into the report in JSON format. <br/>
        <span style="font-style: italic;">Examples</span>: <br>
        <br>
        
        <h4>JSON Structures:</h4>

        <div class="detailSample">

        <pre>
{
  "description": "A long detailed description that will be printed as part of the report."
}
        </pre>
        </div>
        </td>
    </tr>
  </tbody>
</table>

<h4 class="dtH4">JSON Response Example</h4>

<div class="detailSample">
<pre>
{
  "pdfUrl": "http://...../.pdf", 
  "imageUrl": "http://...../.png"
}
</pre>
</div>
</div>
<!--nstext-->
</body>
</html>
